package com.zuipin.entity.shoppingCart;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zuipin.entity.DeliveryAddress;
import com.zuipin.util.ArithUtil;
import com.zuipin.vo.UseRuleSetVo;

/**
 * @description : 购物车数据、参数
 * @author : wuhaijun
 * @date : 2017年5月11日 上午9:53:16
 */
public class CartParam {
	
	private Long					id;													// 购物车ID
	
	private Long					proId;												// 商品ID
	
	private Long					buyerId;											// 买家ID
	
	private Long					sellerId;											// 卖家ID
	
	private Integer					buyNum;												// 购买数量
	
	private String					addTime;											// 加入购物车时间
	
	private Long					packId;												// 泡带ID
	
	private String					packCode;											// 泡带编码
	
	private BigDecimal				packSuttle;											// 泡袋净重
	
	private BigDecimal				actualPayPrice;										// 实际支付价格
	
	private Long					sysId;												// 系统ID
	
	private String					device;												// 设备|终端
	
	private String					cartIds;											// 购物车ID(一个或多个，用英文逗号隔开)
	
	private String					cartSkus;											// 购物车商品sku(一个或多个，用英文逗号隔开)
	
	private List<Gift>				giftList;											// 购物车赠品list
	
	private Integer					useStoreBalance;									// 是否使用储值余额，1是
	
	private Integer					useBackBalance;										// 是否使用返现余额，1是
	
	private Long					receiveAddrId;										// 收货地址ID
	
	private String					provinceCode;										// 省编码
	
	private String					payMethodCode;										// 支付编码
	
	private String					deliveryMethodCode;									// 快递编码
	
	private String					orderRemark;										// 订单备注
	
	private String					invoiceCode;										// 发票编码
	
	private String					invoiceTitle;										// 发票抬头
	
	private Long					useRedPacketId;										// 使用红包ID
	
	private boolean					isRedPacketDedByAll		= true;						// 红包抵扣是否针对整个购物车
	
	private String					useRedPacketName;									// 使用的红包名称
	
	private BigDecimal				redPacketDeduction		= new BigDecimal(0.00);		// 红包抵扣
	
	private BigDecimal				proTotalAmount			= new BigDecimal(0.00);		// 商品总额
	
	private BigDecimal				actualPayTotalAmount	= new BigDecimal(0.00);		// 实际支付总额
	
	private BigDecimal				freight					= new BigDecimal(0.00);		// 运费
	
	private BigDecimal				discountAmount			= new BigDecimal(0.00);		// 优惠金额(优惠针对于整个购物车)
	
	private BigDecimal				dedProTotalAmount		= new BigDecimal(0.00);		// 抵扣后的商品总额
	
	private BigDecimal				totalWeight				= new BigDecimal(0.0000);	// 总重量
	
	private Integer					totalIntegral			= 0;						// 总积分
	
	private DeliveryAddress			deliveryAddress;									// 收货地址
	
	private Boolean					isAgent					= false;					// 是否为代理商
	
	private String					invoiceContent;										// 发票内容 食品、茶叶、茶具（可多选）
	
	private Short					isFromBack;											// 是否后台创建
	
	private String					email;												// 收票人邮箱 发票类型选择“电子发票”时才有该字段和输入框出现
	
	private String					companyName;										// 公司名称 发票类型选择“增值税发票”时才出现
	
	private String					taxpayersNo;										// 纳税人识别号 “普通发票”“电子发票”在公司抬头为公司的时候才会出现，发票类型“增值税发票”始终出现
	
	private String					registerAddress;									// 注册地址 发票类型选择“增值税发票”时才出现
	
	private String					registerMobilePhone;								// 注册电话 发票类型选择“增值税发票”时才出现
	
	private String					openBank;											// 开户银行 发票类型选择“增值税发票”时才出现
	
	private String					openAccount;										// 开户账号 发票类型选择“增值税发票”时才出现
	
	private Long					createId;											// 创建人ID
	
	private BigDecimal				backFreight;										// 后台填写邮费
	
	private String					customerRemark;										// 客服备注
	
	private Integer					growthValue;										// 成长值
	
	private Map<Long, BigDecimal>	limitDisMap				= new HashMap<>();
	
	private Short					isDisableRedpacket;									// 是否禁用红包 1是 0否
	
	private BigDecimal				useRuleDiscountSum		= new BigDecimal(0.00);		// 使用的购物车优惠总金额
	
	private Short					isPremium;											// 是不是赠品 1 是 0不是
	
	private String					proSku;												// 商品sku
	
	private Long					ruleId;												// 规则Id
	
	private String					ruleName;											// 规则名称
	
	private List<UseRuleSetVo>		useRuleSetList;										// 使用规则
	
	private Map<String, BigDecimal>	limitProMap				= new HashMap<>();			// 符合限制规则商品
	
	private String					limitExplain;										// 红包限制说明
	
	private Short					isUseRedPacket;										// 是否使用红包 0 使用红包，1 不使用，
	
	private Map<String, String>		freightProMap			= new HashMap<>();			// 免邮商品
	
	private Map<String, BigDecimal>	weightProMap			= new HashMap<>();			// 每款商品重量
	
	private Short					isUseIntegral;										// 是否使用积分抵扣，1是使用，0是不使用
	
	private Integer					useTotalIntegral		= 0;						// 使用总积分
	
	private Short					isExistIntegralPro;									// 是否存在积分商品1存在，0不存在
	
	private Integer					giveTotalIntegral		= 0;						// 赠送积分
	
	private Integer					remainIntegral			= 0;						// 账户剩余积分
	
	private BigDecimal				amountToIntegral		= new BigDecimal(0.00);		// 积分商品补差价
	
	private Integer					integralProNums			= 0;						// 积分商品数量
	/**
	 * 是否来自后台创建 1是 0否
	 */
	public static final short		IS_FROM_BACK_YES_1		= (short) 1;
	public static final short		IS_FROM_BACK_NO_0		= (short) 0;
	
	/**
	 * 是否禁用红包 1是 0否
	 */
	public static final Short		IS_DISABLE_YES_1		= 1;
	public static final Short		IS_DISABLE_NO_0			= 0;
	
	/**
	 * 是否使用充值余额 1是 0否
	 */
	public static final Integer		IS_USE_YES_1			= 1;
	public static final Integer		IS_USE_NO_0				= 0;
	
	/**
	 * 是否使用红包 0 使用红包，1 不使用，
	 */
	public static final Short		IS_USE_RED_YES_0		= 0;
	public static final Short		IS_USE_RED_NO_1			= 1;
	
	/**
	 * 是否使用积分抵扣，1是使用，0是不使用
	 */
	public static final Short		IS_USE_INTEGRAL_YES_1	= 1;
	public static final Short		IS_USE_INTEGRAL_NO_0	= 0;
	
	/**
	 * 是否存在积分商品1存在，0不存在
	 */
	public static final Short		IS_EXIST_YES_1			= 1;
	public static final Short		IS_EXIST_NO_0			= 0;
	
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	public Long getProId() {
		return proId;
	}
	
	public void setProId(Long proId) {
		this.proId = proId;
	}
	
	public Long getBuyerId() {
		return buyerId;
	}
	
	public void setBuyerId(Long buyerId) {
		this.buyerId = buyerId;
	}
	
	public Long getSellerId() {
		return sellerId;
	}
	
	public void setSellerId(Long sellerId) {
		this.sellerId = sellerId;
	}
	
	public Integer getBuyNum() {
		return buyNum;
	}
	
	public void setBuyNum(Integer buyNum) {
		this.buyNum = buyNum;
	}
	
	public String getAddTime() {
		return addTime;
	}
	
	public void setAddTime(String addTime) {
		this.addTime = addTime;
	}
	
	public Long getPackId() {
		return packId;
	}
	
	public void setPackId(Long packId) {
		this.packId = packId;
	}
	
	public String getPackCode() {
		return packCode;
	}
	
	public void setPackCode(String packCode) {
		this.packCode = packCode;
	}
	
	public BigDecimal getPackSuttle() {
		return packSuttle;
	}
	
	public void setPackSuttle(BigDecimal packSuttle) {
		this.packSuttle = packSuttle;
	}
	
	public BigDecimal getActualPayPrice() {
		return actualPayPrice;
	}
	
	public void setActualPayPrice(BigDecimal actualPayPrice) {
		this.actualPayPrice = actualPayPrice;
	}
	
	public Long getSysId() {
		return sysId;
	}
	
	public void setSysId(Long sysId) {
		this.sysId = sysId;
	}
	
	public String getDevice() {
		return device;
	}
	
	public void setDevice(String device) {
		this.device = device;
	}
	
	public String getCartIds() {
		return cartIds;
	}
	
	public void setCartIds(String cartIds) {
		this.cartIds = cartIds;
	}
	
	public String getCartSkus() {
		return cartSkus;
	}
	
	public void setCartSkus(String cartSkus) {
		this.cartSkus = cartSkus;
	}
	
	public List<Gift> getGiftList() {
		return giftList;
	}
	
	public void setGiftList(List<Gift> giftList) {
		this.giftList = giftList;
	}
	
	public Integer getUseStoreBalance() {
		return useStoreBalance;
	}
	
	public void setUseStoreBalance(Integer useStoreBalance) {
		this.useStoreBalance = useStoreBalance;
	}
	
	public Integer getUseBackBalance() {
		return useBackBalance;
	}
	
	public void setUseBackBalance(Integer useBackBalance) {
		this.useBackBalance = useBackBalance;
	}
	
	public Long getReceiveAddrId() {
		return receiveAddrId;
	}
	
	public void setReceiveAddrId(Long receiveAddrId) {
		this.receiveAddrId = receiveAddrId;
	}
	
	public String getProvinceCode() {
		return provinceCode;
	}
	
	public void setProvinceCode(String provinceCode) {
		this.provinceCode = provinceCode;
	}
	
	public String getPayMethodCode() {
		return payMethodCode;
	}
	
	public void setPayMethodCode(String payMethodCode) {
		this.payMethodCode = payMethodCode;
	}
	
	public String getDeliveryMethodCode() {
		return deliveryMethodCode;
	}
	
	public void setDeliveryMethodCode(String deliveryMethodCode) {
		this.deliveryMethodCode = deliveryMethodCode;
	}
	
	public String getOrderRemark() {
		return orderRemark;
	}
	
	public void setOrderRemark(String orderRemark) {
		this.orderRemark = orderRemark;
	}
	
	public String getInvoiceCode() {
		return invoiceCode;
	}
	
	public void setInvoiceCode(String invoiceCode) {
		this.invoiceCode = invoiceCode;
	}
	
	public String getInvoiceTitle() {
		return invoiceTitle;
	}
	
	public void setInvoiceTitle(String invoiceTitle) {
		this.invoiceTitle = invoiceTitle;
	}
	
	public Long getUseRedPacketId() {
		return useRedPacketId;
	}
	
	public void setUseRedPacketId(Long useRedPacketId) {
		this.useRedPacketId = useRedPacketId;
	}
	
	public boolean getIsRedPacketDedByAll() {
		return isRedPacketDedByAll;
	}
	
	public void setIsRedPacketDedByAll(boolean isRedPacketDedByAll) {
		this.isRedPacketDedByAll = isRedPacketDedByAll;
	}
	
	public String getUseRedPacketName() {
		return useRedPacketName;
	}
	
	public void setUseRedPacketName(String useRedPacketName) {
		this.useRedPacketName = useRedPacketName;
	}
	
	public BigDecimal getRedPacketDeduction() {
		return redPacketDeduction;
	}
	
	public void setRedPacketDeduction(BigDecimal redPacketDeduction) {
		this.redPacketDeduction = redPacketDeduction;
	}
	
	public BigDecimal getProTotalAmount() {
		return proTotalAmount;
	}
	
	public void setProTotalAmount(BigDecimal proTotalAmount) {
		this.proTotalAmount = proTotalAmount;
	}
	
	public BigDecimal getActualPayTotalAmount() {
		return actualPayTotalAmount;
	}
	
	public void setActualPayTotalAmount(BigDecimal actualPayTotalAmount) {
		this.actualPayTotalAmount = actualPayTotalAmount;
	}
	
	public BigDecimal getFreight() {
		return freight;
	}
	
	public void setFreight(BigDecimal freight) {
		this.freight = freight;
	}
	
	public BigDecimal getDiscountAmount() {
		return discountAmount;
	}
	
	public void setDiscountAmount(BigDecimal discountAmount) {
		this.discountAmount = discountAmount;
	}
	
	public BigDecimal getDedProTotalAmount() {
		return dedProTotalAmount;
	}
	
	public void setDedProTotalAmount(BigDecimal dedProTotalAmount) {
		this.dedProTotalAmount = dedProTotalAmount;
	}
	
	public BigDecimal getTotalWeight() {
		return totalWeight;
	}
	
	public void setTotalWeight(BigDecimal totalWeight) {
		this.totalWeight = totalWeight;
	}
	
	public Integer getTotalIntegral() {
		return totalIntegral;
	}
	
	public void setTotalIntegral(Integer totalIntegral) {
		this.totalIntegral = totalIntegral;
	}
	
	public DeliveryAddress getDeliveryAddress() {
		return deliveryAddress;
	}
	
	public void setDeliveryAddress(DeliveryAddress deliveryAddress) {
		this.deliveryAddress = deliveryAddress;
	}
	
	public Boolean getIsAgent() {
		return isAgent;
	}
	
	public void setIsAgent(Boolean isAgent) {
		this.isAgent = isAgent;
	}
	
	public void setLimitDisMap(Long cartId, BigDecimal disAmount) {
		if (limitDisMap.get(cartId) == null) {
			limitDisMap.put(cartId, new BigDecimal(0.00));
		}
		limitDisMap.put(cartId, ArithUtil.add(limitDisMap.get(cartId), disAmount, 2));
	}
	
	public BigDecimal getLimitDisMap(Long cartId) {
		if (limitDisMap.get(cartId) == null) {
			return new BigDecimal(0.00);
		}
		return limitDisMap.get(cartId);
	}
	
	public String getInvoiceContent() {
		return invoiceContent;
	}
	
	public void setInvoiceContent(String invoiceContent) {
		this.invoiceContent = invoiceContent;
	}
	
	public Short getIsFromBack() {
		return isFromBack;
	}
	
	public void setIsFromBack(Short isFromBack) {
		this.isFromBack = isFromBack;
	}
	
	public String getEmail() {
		return email;
	}
	
	public void setEmail(String email) {
		this.email = email;
	}
	
	public String getCompanyName() {
		return companyName;
	}
	
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	
	public String getTaxpayersNo() {
		return taxpayersNo;
	}
	
	public void setTaxpayersNo(String taxpayersNo) {
		this.taxpayersNo = taxpayersNo;
	}
	
	public String getRegisterAddress() {
		return registerAddress;
	}
	
	public void setRegisterAddress(String registerAddress) {
		this.registerAddress = registerAddress;
	}
	
	public String getRegisterMobilePhone() {
		return registerMobilePhone;
	}
	
	public void setRegisterMobilePhone(String registerMobilePhone) {
		this.registerMobilePhone = registerMobilePhone;
	}
	
	public String getOpenBank() {
		return openBank;
	}
	
	public void setOpenBank(String openBank) {
		this.openBank = openBank;
	}
	
	public String getOpenAccount() {
		return openAccount;
	}
	
	public void setOpenAccount(String openAccount) {
		this.openAccount = openAccount;
	}
	
	public Map<Long, BigDecimal> getLimitDisMap() {
		return limitDisMap;
	}
	
	public void setLimitDisMap(Map<Long, BigDecimal> limitDisMap) {
		this.limitDisMap = limitDisMap;
	}
	
	public void setRedPacketDedByAll(boolean isRedPacketDedByAll) {
		this.isRedPacketDedByAll = isRedPacketDedByAll;
	}
	
	public Long getCreateId() {
		return createId;
	}
	
	public void setCreateId(Long createId) {
		this.createId = createId;
	}
	
	public BigDecimal getBackFreight() {
		return backFreight;
	}
	
	public void setBackFreight(BigDecimal backFreight) {
		this.backFreight = backFreight;
	}
	
	public String getCustomerRemark() {
		return customerRemark;
	}
	
	public void setCustomerRemark(String customerRemark) {
		this.customerRemark = customerRemark;
	}
	
	public Integer getGrowthValue() {
		return growthValue;
	}
	
	public void setGrowthValue(Integer growthValue) {
		this.growthValue = growthValue;
	}
	
	public Short getIsDisableRedpacket() {
		return isDisableRedpacket;
	}
	
	public void setIsDisableRedpacket(Short isDisableRedpacket) {
		this.isDisableRedpacket = isDisableRedpacket;
	}
	
	public BigDecimal getUseRuleDiscountSum() {
		return useRuleDiscountSum;
	}
	
	public void setUseRuleDiscountSum(BigDecimal useRuleDiscountSum) {
		this.useRuleDiscountSum = useRuleDiscountSum;
	}
	
	public Short getIsPremium() {
		return isPremium;
	}
	
	public void setIsPremium(Short isPremium) {
		this.isPremium = isPremium;
	}
	
	public String getProSku() {
		return proSku;
	}
	
	public void setProSku(String proSku) {
		this.proSku = proSku;
	}
	
	/**
	 * @return the ruleId
	 */
	public Long getRuleId() {
		return ruleId;
	}
	
	/**
	 * @param ruleId the ruleId to set
	 */
	public void setRuleId(Long ruleId) {
		this.ruleId = ruleId;
	}
	
	/**
	 * @return the ruleName
	 */
	public String getRuleName() {
		return ruleName;
	}
	
	/**
	 * @param ruleName the ruleName to set
	 */
	public void setRuleName(String ruleName) {
		this.ruleName = ruleName;
	}
	
	public List<UseRuleSetVo> getUseRuleSetList() {
		return useRuleSetList;
	}
	
	public void setUseRuleSetList(List<UseRuleSetVo> useRuleSetList) {
		this.useRuleSetList = useRuleSetList;
	}
	
	public Map<String, BigDecimal> getLimitProMap() {
		return limitProMap;
	}
	
	public void setLimitProMap(Map<String, BigDecimal> limitProMap) {
		this.limitProMap = limitProMap;
	}
	
	public String getLimitExplain() {
		return limitExplain;
	}
	
	public void setLimitExplain(String limitExplain) {
		this.limitExplain = limitExplain;
	}
	
	public Short getIsUseRedPacket() {
		return isUseRedPacket;
	}
	
	public void setIsUseRedPacket(Short isUseRedPacket) {
		this.isUseRedPacket = isUseRedPacket;
	}
	
	public Map<String, String> getFreightProMap() {
		return freightProMap;
	}
	
	public void setFreightProMap(Map<String, String> freightProMap) {
		this.freightProMap = freightProMap;
	}
	
	public Map<String, BigDecimal> getWeightProMap() {
		return weightProMap;
	}
	
	public void setWeightProMap(Map<String, BigDecimal> weightProMap) {
		this.weightProMap = weightProMap;
	}
	
	public Short getIsUseIntegral() {
		return isUseIntegral;
	}
	
	public void setIsUseIntegral(Short isUseIntegral) {
		this.isUseIntegral = isUseIntegral;
	}
	
	public Integer getUseTotalIntegral() {
		return useTotalIntegral;
	}
	
	public void setUseTotalIntegral(Integer useTotalIntegral) {
		this.useTotalIntegral = useTotalIntegral;
	}
	
	public Short getIsExistIntegralPro() {
		return isExistIntegralPro;
	}
	
	public void setIsExistIntegralPro(Short isExistIntegralPro) {
		this.isExistIntegralPro = isExistIntegralPro;
	}
	
	public Integer getGiveTotalIntegral() {
		return giveTotalIntegral;
	}
	
	public void setGiveTotalIntegral(Integer giveTotalIntegral) {
		this.giveTotalIntegral = giveTotalIntegral;
	}
	
	public Integer getRemainIntegral() {
		return remainIntegral;
	}
	
	public void setRemainIntegral(Integer remainIntegral) {
		this.remainIntegral = remainIntegral;
	}
	
	public BigDecimal getAmountToIntegral() {
		return amountToIntegral;
	}
	
	public void setAmountToIntegral(BigDecimal amountToIntegral) {
		this.amountToIntegral = amountToIntegral;
	}
	
	public Integer getIntegralProNums() {
		return integralProNums;
	}
	
	public void setIntegralProNums(Integer integralProNums) {
		this.integralProNums = integralProNums;
	}
	
}
